package com.lee.crawler.gov.job;

import org.quartz.DisallowConcurrentExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.lee.crawler.gov.strategy.list.ListStrategyFactory;

@Component
@DisallowConcurrentExecution
public class GovArticleJob {

	@Autowired
	private ListStrategyFactory listStrategyFactory;

	@Scheduled(cron = "0 */1 * * * ?")
	public void init() {
		listStrategyFactory.getListStrategys().values().forEach(listStrategy -> {
			listStrategy.saveCrawlerArticles();
		});
	}

}
